#!/bin/bash

build_dir="cmd/webhook"
tmp_dir="tmp"
SHELL_FOLDER=$(dirname "$0")
webhook=$(dirname $SHELL_FOLDER)

cd $webhook || exit

if [ ! -d $tmp_dir ]; then
  mkdir $tmp_dir
fi

go build -o "$tmp_dir/webhook" "$build_dir/main.go"

scp "$tmp_dir/webhook" root@119.91.85.232:/root/
